3.12.3 \(\int (a+i a \tan (e+f x)) \sqrt {c+d \tan (e+f x)} \, dx\) [1103]

Optimal. Leaf size=69 \[ -\frac {2 i a \sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f}+\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f} \]

[Out]

-2*I*a*arctanh((c+d*tan(f*x+e))^(1/2)/(c-I*d)^(1/2))*(c-I*d)^(1/2)/f+2*I*a*(c+d*tan(f*x+e))^(1/2)/f

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3609, 3618, 65, 214} \begin {gather*} \frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}-\frac {2 i a \sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])*Sqrt[c + d*Tan[e + f*x]],x]

[Out]

((-2*I)*a*Sqrt[c - I*d]*ArcTanh[Sqrt[c + d*Tan[e + f*x]]/Sqrt[c - I*d]])/f + ((2*I)*a*Sqrt[c + d*Tan[e + f*x]]
)/f

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3618

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c*(
d/f), Subst[Int[(a + (b/d)*x)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] &&
NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x)) \sqrt {c+d \tan (e+f x)} \, dx &=\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}+\int \frac {a (c-i d)+a (i c+d) \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx\\ &=\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}+\frac {\left (i a^2 (c-i d)^2\right ) \text {Subst}\left (\int \frac {1}{\left (a^2 (i c+d)^2+a (c-i d) x\right ) \sqrt {c+\frac {d x}{a (i c+d)}}} \, dx,x,a (i c+d) \tan (e+f x)\right )}{f}\\ &=\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}-\frac {\left (2 a^3 (c-i d)^3\right ) \text {Subst}\left (\int \frac {1}{-\frac {a^2 c (c-i d) (i c+d)}{d}+a^2 (i c+d)^2+\frac {a^2 (c-i d) (i c+d) x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{d f}\\ &=-\frac {2 i a \sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f}+\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.22, size = 88, normalized size = 1.28 \begin {gather*} \frac {2 i a \left (-\sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c-\frac {i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}}{\sqrt {c-i d}}\right )+\sqrt {c+d \tan (e+f x)}\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])*Sqrt[c + d*Tan[e + f*x]],x]

[Out]

((2*I)*a*(-(Sqrt[c - I*d]*ArcTanh[Sqrt[c - (I*d*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I)*(e + f*x)))]/Sqrt[c
- I*d]]) + Sqrt[c + d*Tan[e + f*x]]))/f

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 684 vs. \(2 (57 ) = 114\).
time = 0.29, size = 685, normalized size = 9.93

method result size
derivativedivides \(\frac {a \left (2 i \sqrt {c +d \tan \left (f x +e \right )}+\frac {-\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \ln \left (\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-d \tan \left (f x +e \right )-c -\sqrt {c^{2}+d^{2}}\right )+\frac {4 \left (2 i \sqrt {c^{2}+d^{2}}\, c +2 i c^{2}+2 i d^{2}+\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-2 \sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{4 \sqrt {c^{2}+d^{2}}+4 c}+\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )+\frac {4 \left (-2 i \sqrt {c^{2}+d^{2}}\, c -2 i c^{2}-2 i d^{2}-\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{4 \sqrt {c^{2}+d^{2}}+4 c}\right )}{f}\) \(685\)
default \(\frac {a \left (2 i \sqrt {c +d \tan \left (f x +e \right )}+\frac {-\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \ln \left (\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-d \tan \left (f x +e \right )-c -\sqrt {c^{2}+d^{2}}\right )+\frac {4 \left (2 i \sqrt {c^{2}+d^{2}}\, c +2 i c^{2}+2 i d^{2}+\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-2 \sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{4 \sqrt {c^{2}+d^{2}}+4 c}+\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )+\frac {4 \left (-2 i \sqrt {c^{2}+d^{2}}\, c -2 i c^{2}-2 i d^{2}-\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{4 \sqrt {c^{2}+d^{2}}+4 c}\right )}{f}\) \(685\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*tan(f*x+e))^(1/2)*(a+I*a*tan(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f*a*(2*I*(c+d*tan(f*x+e))^(1/2)+2/(4*(c^2+d^2)^(1/2)+4*c)*(-1/2*(-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*(c^2+d^2)^
(1/2)-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c-(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*d)*ln((c+d*tan(f*x+e))^(1/2)*(2*(c^2+d^2
)^(1/2)+2*c)^(1/2)-d*tan(f*x+e)-c-(c^2+d^2)^(1/2))+2*(2*I*(c^2+d^2)^(1/2)*c+2*I*c^2+2*I*d^2+1/2*(-I*(2*(c^2+d^
2)^(1/2)+2*c)^(1/2)*(c^2+d^2)^(1/2)-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c-(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*d)*(2*(c^2
+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)*arctan(((2*(c^2+d^2)^(1/2)+2*c)^(1/2)-2*(c+d*tan(f*x+e))
^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)))+2/(4*(c^2+d^2)^(1/2)+4*c)*(1/2*(-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*(c^2+
d^2)^(1/2)-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c-(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*d)*ln(d*tan(f*x+e)+c+(c+d*tan(f*x+e
))^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)+(c^2+d^2)^(1/2))+2*(-2*I*(c^2+d^2)^(1/2)*c-2*I*c^2-2*I*d^2-1/2*(-I*(2*(
c^2+d^2)^(1/2)+2*c)^(1/2)*(c^2+d^2)^(1/2)-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c-(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*d)*(
2*(c^2+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)*arctan((2*(c+d*tan(f*x+e))^(1/2)+(2*(c^2+d^2)^(1/2
)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2))))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 4714 vs. \(2 (55) = 110\).
time = 0.70, size = 4714, normalized size = 68.32 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^(1/2)*(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

-4*((2*(I*sqrt(2)*a*cos(2*f*x + 2*e) - sqrt(2)*a*sin(2*f*x + 2*e) + I*sqrt(2)*a)*arctan2(-2*d*cos(2*f*x + 2*e)
 + 2*c*sin(2*f*x + 2*e) - (4*c^2*cos(2*f*x + 2*e)^2 + 4*c^2*sin(2*f*x + 2*e)^2 + (c^2 + d^2)*cos(4*f*x + 4*e)^
2 + 4*c^2*cos(2*f*x + 2*e) + (c^2 + d^2)*sin(4*f*x + 4*e)^2 + 4*c*d*sin(2*f*x + 2*e) + c^2 + d^2 + 2*(2*c^2*co
s(2*f*x + 2*e) - 2*c*d*sin(2*f*x + 2*e) + c^2 - d^2)*cos(4*f*x + 4*e) + 4*(c*d*cos(2*f*x + 2*e) + c^2*sin(2*f*
x + 2*e) + c*d)*sin(4*f*x + 4*e))^(1/4)*(sqrt(2)*sqrt(-c + sqrt(c^2 + d^2))*cos(1/2*arctan2(-d*cos(4*f*x + 4*e
) + c*sin(4*f*x + 4*e) + 2*c*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f*x + 4
*e) + c)) - sqrt(2)*sqrt(c + sqrt(c^2 + d^2))*sin(1/2*arctan2(-d*cos(4*f*x + 4*e) + c*sin(4*f*x + 4*e) + 2*c*s
in(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f*x + 4*e) + c))), 2*c*cos(2*f*x + 2*
e) + 2*d*sin(2*f*x + 2*e) + (4*c^2*cos(2*f*x + 2*e)^2 + 4*c^2*sin(2*f*x + 2*e)^2 + (c^2 + d^2)*cos(4*f*x + 4*e
)^2 + 4*c^2*cos(2*f*x + 2*e) + (c^2 + d^2)*sin(4*f*x + 4*e)^2 + 4*c*d*sin(2*f*x + 2*e) + c^2 + d^2 + 2*(2*c^2*
cos(2*f*x + 2*e) - 2*c*d*sin(2*f*x + 2*e) + c^2 - d^2)*cos(4*f*x + 4*e) + 4*(c*d*cos(2*f*x + 2*e) + c^2*sin(2*
f*x + 2*e) + c*d)*sin(4*f*x + 4*e))^(1/4)*(sqrt(2)*sqrt(c + sqrt(c^2 + d^2))*cos(1/2*arctan2(-d*cos(4*f*x + 4*
e) + c*sin(4*f*x + 4*e) + 2*c*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f*x +
4*e) + c)) + sqrt(2)*sqrt(-c + sqrt(c^2 + d^2))*sin(1/2*arctan2(-d*cos(4*f*x + 4*e) + c*sin(4*f*x + 4*e) + 2*c
*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f*x + 4*e) + c))) + 2*c) + (sqrt(2)
*a*cos(2*f*x + 2*e) + I*sqrt(2)*a*sin(2*f*x + 2*e) + sqrt(2)*a)*log(8*c^2*cos(2*f*x + 2*e) + 4*(c^2 + d^2)*cos
(2*f*x + 2*e)^2 + 8*c*d*sin(2*f*x + 2*e) + 4*(c^2 + d^2)*sin(2*f*x + 2*e)^2 + 4*sqrt(4*c^2*cos(2*f*x + 2*e)^2
+ 4*c^2*sin(2*f*x + 2*e)^2 + (c^2 + d^2)*cos(4*f*x + 4*e)^2 + 4*c^2*cos(2*f*x + 2*e) + (c^2 + d^2)*sin(4*f*x +
 4*e)^2 + 4*c*d*sin(2*f*x + 2*e) + c^2 + d^2 + 2*(2*c^2*cos(2*f*x + 2*e) - 2*c*d*sin(2*f*x + 2*e) + c^2 - d^2)
*cos(4*f*x + 4*e) + 4*(c*d*cos(2*f*x + 2*e) + c^2*sin(2*f*x + 2*e) + c*d)*sin(4*f*x + 4*e))*sqrt(c^2 + d^2)*(c
os(1/2*arctan2(-d*cos(4*f*x + 4*e) + c*sin(4*f*x + 4*e) + 2*c*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*c
os(2*f*x + 2*e) + d*sin(4*f*x + 4*e) + c))^2 + sin(1/2*arctan2(-d*cos(4*f*x + 4*e) + c*sin(4*f*x + 4*e) + 2*c*
sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f*x + 4*e) + c))^2) + 4*c^2 + 4*(4*c
^2*cos(2*f*x + 2*e)^2 + 4*c^2*sin(2*f*x + 2*e)^2 + (c^2 + d^2)*cos(4*f*x + 4*e)^2 + 4*c^2*cos(2*f*x + 2*e) + (
c^2 + d^2)*sin(4*f*x + 4*e)^2 + 4*c*d*sin(2*f*x + 2*e) + c^2 + d^2 + 2*(2*c^2*cos(2*f*x + 2*e) - 2*c*d*sin(2*f
*x + 2*e) + c^2 - d^2)*cos(4*f*x + 4*e) + 4*(c*d*cos(2*f*x + 2*e) + c^2*sin(2*f*x + 2*e) + c*d)*sin(4*f*x + 4*
e))^(1/4)*(((sqrt(2)*c*cos(2*f*x + 2*e) + sqrt(2)*d*sin(2*f*x + 2*e) + sqrt(2)*c)*cos(1/2*arctan2(-d*cos(4*f*x
 + 4*e) + c*sin(4*f*x + 4*e) + 2*c*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f
*x + 4*e) + c)) - (sqrt(2)*d*cos(2*f*x + 2*e) - sqrt(2)*c*sin(2*f*x + 2*e))*sin(1/2*arctan2(-d*cos(4*f*x + 4*e
) + c*sin(4*f*x + 4*e) + 2*c*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f*x + 4
*e) + c)))*sqrt(c + sqrt(c^2 + d^2)) + ((sqrt(2)*d*cos(2*f*x + 2*e) - sqrt(2)*c*sin(2*f*x + 2*e))*cos(1/2*arct
an2(-d*cos(4*f*x + 4*e) + c*sin(4*f*x + 4*e) + 2*c*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x +
2*e) + d*sin(4*f*x + 4*e) + c)) + (sqrt(2)*c*cos(2*f*x + 2*e) + sqrt(2)*d*sin(2*f*x + 2*e) + sqrt(2)*c)*sin(1/
2*arctan2(-d*cos(4*f*x + 4*e) + c*sin(4*f*x + 4*e) + 2*c*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*
f*x + 2*e) + d*sin(4*f*x + 4*e) + c)))*sqrt(-c + sqrt(c^2 + d^2)))))*sqrt(c + sqrt(c^2 + d^2)) + (2*(sqrt(2)*a
*cos(2*f*x + 2*e) + I*sqrt(2)*a*sin(2*f*x + 2*e) + sqrt(2)*a)*arctan2(-2*d*cos(2*f*x + 2*e) + 2*c*sin(2*f*x +
2*e) - (4*c^2*cos(2*f*x + 2*e)^2 + 4*c^2*sin(2*f*x + 2*e)^2 + (c^2 + d^2)*cos(4*f*x + 4*e)^2 + 4*c^2*cos(2*f*x
 + 2*e) + (c^2 + d^2)*sin(4*f*x + 4*e)^2 + 4*c*d*sin(2*f*x + 2*e) + c^2 + d^2 + 2*(2*c^2*cos(2*f*x + 2*e) - 2*
c*d*sin(2*f*x + 2*e) + c^2 - d^2)*cos(4*f*x + 4*e) + 4*(c*d*cos(2*f*x + 2*e) + c^2*sin(2*f*x + 2*e) + c*d)*sin
(4*f*x + 4*e))^(1/4)*(sqrt(2)*sqrt(-c + sqrt(c^2 + d^2))*cos(1/2*arctan2(-d*cos(4*f*x + 4*e) + c*sin(4*f*x + 4
*e) + 2*c*sin(2*f*x + 2*e) + d, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f*x + 4*e) + c)) - sqrt(2)
*sqrt(c + sqrt(c^2 + d^2))*sin(1/2*arctan2(-d*cos(4*f*x + 4*e) + c*sin(4*f*x + 4*e) + 2*c*sin(2*f*x + 2*e) + d
, c*cos(4*f*x + 4*e) + 2*c*cos(2*f*x + 2*e) + d*sin(4*f*x + 4*e) + c))), 2*c*cos(2*f*x + 2*e) + 2*d*sin(2*f*x
+ 2*e) + (4*c^2*cos(2*f*x + 2*e)^2 + 4*c^2*sin(2*f*x + 2*e)^2 + (c^2 + d^2)*cos(4*f*x + 4*e)^2 + 4*c^2*cos(2*f
*x + 2*e) + (c^2 + d^2)*sin(4*f*x + 4*e)^2 + 4*c*d*sin(2*f*x + 2*e) + c^2 + d^2 + 2*(2*c^2*cos(2*f*x + 2*e) -
2*c*d*sin(2*f*x + 2*e) + c^2 - d^2)*cos(4*f*x +...

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 318 vs. \(2 (55) = 110\).
time = 0.91, size = 318, normalized size = 4.61 \begin {gather*} \frac {f \sqrt {-\frac {a^{2} c - i \, a^{2} d}{f^{2}}} \log \left (\frac {2 \, {\left (a c + {\left (i \, f e^{\left (2 i \, f x + 2 i \, e\right )} + i \, f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {a^{2} c - i \, a^{2} d}{f^{2}}} + {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{a}\right ) - f \sqrt {-\frac {a^{2} c - i \, a^{2} d}{f^{2}}} \log \left (\frac {2 \, {\left (a c + {\left (-i \, f e^{\left (2 i \, f x + 2 i \, e\right )} - i \, f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {a^{2} c - i \, a^{2} d}{f^{2}}} + {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{a}\right ) + 4 i \, a \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^(1/2)*(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(f*sqrt(-(a^2*c - I*a^2*d)/f^2)*log(2*(a*c + (I*f*e^(2*I*f*x + 2*I*e) + I*f)*sqrt(((c - I*d)*e^(2*I*f*x +
2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(-(a^2*c - I*a^2*d)/f^2) + (a*c - I*a*d)*e^(2*I*f*x + 2*I*e))
*e^(-2*I*f*x - 2*I*e)/a) - f*sqrt(-(a^2*c - I*a^2*d)/f^2)*log(2*(a*c + (-I*f*e^(2*I*f*x + 2*I*e) - I*f)*sqrt((
(c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(-(a^2*c - I*a^2*d)/f^2) + (a*c - I*a*
d)*e^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e)/a) + 4*I*a*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I
*f*x + 2*I*e) + 1)))/f

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} i a \left (\int \left (- i \sqrt {c + d \tan {\left (e + f x \right )}}\right )\, dx + \int \sqrt {c + d \tan {\left (e + f x \right )}} \tan {\left (e + f x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))**(1/2)*(a+I*a*tan(f*x+e)),x)

[Out]

I*a*(Integral(-I*sqrt(c + d*tan(e + f*x)), x) + Integral(sqrt(c + d*tan(e + f*x))*tan(e + f*x), x))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 185 vs. \(2 (55) = 110\).
time = 0.48, size = 185, normalized size = 2.68 \begin {gather*} \frac {2 i \, \sqrt {d \tan \left (f x + e\right ) + c} a}{f} + \frac {4 \, {\left (i \, a c + a d\right )} \arctan \left (\frac {2 \, {\left (\sqrt {d \tan \left (f x + e\right ) + c} c - \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} - i \, \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d - \sqrt {c^{2} + d^{2}} \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{\sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} f {\left (-\frac {i \, d}{c - \sqrt {c^{2} + d^{2}}} + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^(1/2)*(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

2*I*sqrt(d*tan(f*x + e) + c)*a/f + 4*(I*a*c + a*d)*arctan(2*(sqrt(d*tan(f*x + e) + c)*c - sqrt(c^2 + d^2)*sqrt
(d*tan(f*x + e) + c))/(c*sqrt(-2*c + 2*sqrt(c^2 + d^2)) - I*sqrt(-2*c + 2*sqrt(c^2 + d^2))*d - sqrt(c^2 + d^2)
*sqrt(-2*c + 2*sqrt(c^2 + d^2))))/(sqrt(-2*c + 2*sqrt(c^2 + d^2))*f*(-I*d/(c - sqrt(c^2 + d^2)) + 1))

________________________________________________________________________________________

Mupad [B]
time = 7.20, size = 854, normalized size = 12.38 \begin {gather*} -2\,\mathrm {atanh}\left (\frac {32\,a^2\,d^4\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}}{4\,f^4}-\frac {a^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{\frac {a\,d^4\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f^3}+\frac {a\,c^2\,d^2\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f^3}}+\frac {32\,c\,d^2\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}}{4\,f^4}-\frac {a^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-a^4\,d^2\,f^4}}{\frac {a\,d^4\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f}+\frac {a\,c^2\,d^2\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f}}\right )\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}+a^2\,c\,f^2}{4\,f^4}}+2\,\mathrm {atanh}\left (\frac {32\,a^2\,d^4\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}}{4\,f^4}-\frac {a^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{\frac {a\,d^4\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f^3}+\frac {a\,c^2\,d^2\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f^3}}-\frac {32\,c\,d^2\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}}{4\,f^4}-\frac {a^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-a^4\,d^2\,f^4}}{\frac {a\,d^4\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f}+\frac {a\,c^2\,d^2\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f}}\right )\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}-a^2\,c\,f^2}{4\,f^4}}-\mathrm {atanh}\left (\frac {f^3\,\left (\frac {16\,\left (a^2\,d^4-a^2\,c^2\,d^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^2}+\frac {16\,c\,d^2\,\left (\sqrt {-a^4\,d^2\,f^4}+a^2\,c\,f^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^4}\right )\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}+a^2\,c\,f^2}{f^4}}}{16\,\left (a^3\,c^2\,d^3+a^3\,d^5\right )}\right )\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}+a^2\,c\,f^2}{f^4}}-\mathrm {atanh}\left (\frac {f^3\,\left (\frac {16\,\left (a^2\,d^4-a^2\,c^2\,d^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^2}-\frac {16\,c\,d^2\,\left (\sqrt {-a^4\,d^2\,f^4}-a^2\,c\,f^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^4}\right )\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}-a^2\,c\,f^2}{f^4}}}{16\,\left (a^3\,c^2\,d^3+a^3\,d^5\right )}\right )\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}-a^2\,c\,f^2}{f^4}}+\frac {a\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,2{}\mathrm {i}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)*(c + d*tan(e + f*x))^(1/2),x)

[Out]

2*atanh((32*a^2*d^4*((-a^4*d^2*f^4)^(1/2)/(4*f^4) - (a^2*c)/(4*f^2))^(1/2)*(c + d*tan(e + f*x))^(1/2))/((a*d^4
*(-a^4*d^2*f^4)^(1/2)*16i)/f^3 + (a*c^2*d^2*(-a^4*d^2*f^4)^(1/2)*16i)/f^3) - (32*c*d^2*((-a^4*d^2*f^4)^(1/2)/(
4*f^4) - (a^2*c)/(4*f^2))^(1/2)*(c + d*tan(e + f*x))^(1/2)*(-a^4*d^2*f^4)^(1/2))/((a*d^4*(-a^4*d^2*f^4)^(1/2)*
16i)/f + (a*c^2*d^2*(-a^4*d^2*f^4)^(1/2)*16i)/f))*(((-a^4*d^2*f^4)^(1/2) - a^2*c*f^2)/(4*f^4))^(1/2) - 2*atanh
((32*a^2*d^4*(- (-a^4*d^2*f^4)^(1/2)/(4*f^4) - (a^2*c)/(4*f^2))^(1/2)*(c + d*tan(e + f*x))^(1/2))/((a*d^4*(-a^
4*d^2*f^4)^(1/2)*16i)/f^3 + (a*c^2*d^2*(-a^4*d^2*f^4)^(1/2)*16i)/f^3) + (32*c*d^2*(- (-a^4*d^2*f^4)^(1/2)/(4*f
^4) - (a^2*c)/(4*f^2))^(1/2)*(c + d*tan(e + f*x))^(1/2)*(-a^4*d^2*f^4)^(1/2))/((a*d^4*(-a^4*d^2*f^4)^(1/2)*16i
)/f + (a*c^2*d^2*(-a^4*d^2*f^4)^(1/2)*16i)/f))*(-((-a^4*d^2*f^4)^(1/2) + a^2*c*f^2)/(4*f^4))^(1/2) - atanh((f^
3*((16*(a^2*d^4 - a^2*c^2*d^2)*(c + d*tan(e + f*x))^(1/2))/f^2 + (16*c*d^2*((-a^4*d^2*f^4)^(1/2) + a^2*c*f^2)*
(c + d*tan(e + f*x))^(1/2))/f^4)*(-((-a^4*d^2*f^4)^(1/2) + a^2*c*f^2)/f^4)^(1/2))/(16*(a^3*d^5 + a^3*c^2*d^3))
)*(-((-a^4*d^2*f^4)^(1/2) + a^2*c*f^2)/f^4)^(1/2) - atanh((f^3*((16*(a^2*d^4 - a^2*c^2*d^2)*(c + d*tan(e + f*x
))^(1/2))/f^2 - (16*c*d^2*((-a^4*d^2*f^4)^(1/2) - a^2*c*f^2)*(c + d*tan(e + f*x))^(1/2))/f^4)*(((-a^4*d^2*f^4)
^(1/2) - a^2*c*f^2)/f^4)^(1/2))/(16*(a^3*d^5 + a^3*c^2*d^3)))*(((-a^4*d^2*f^4)^(1/2) - a^2*c*f^2)/f^4)^(1/2) +
 (a*(c + d*tan(e + f*x))^(1/2)*2i)/f

________________________________________________________________________________________